<?php
C("debug", 0);
$title = htmlspecialchars($_POST['pictitle'], ENT_QUOTES);
$upload = new upload('', '', C("EDITOR_FILE_SIZE"));
$uploadFile = $upload->upload();
$error = empty($upload->error) ? 0 : 1;
$url = __ROOT__ . '/' . $uploadFile[0]['path'];
if($error){
$json = array(
		"error"=>$error,
		"message"=>$upload->error,
	);
}else{
	$json = array(
		"error"=>0,
		"url"=>$url
	);
}
echo json_encode($json);
?>